<h1><%= "#{t(:listing)} #{(:payments)}" %></h1>

<table>
  <thead>
    <tr>
      <th><%= t :invoice %></th>
      <th><%= t :amount %></th>
      <th><%= t :change %></th>
      <th><%= t :payment_method %></th>
      <th><%= t :card_number %></th>
      <th><%= t :card_provider %></th>
      <th><%= t :card_transaction_ref %></th>
      <th><%= t :created_at %></th>
      <th><%= t :updated_at %></th>
      <th><%= t :created_by %></th>
      <th><%= t :updated_by %></th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @payments.each do |payment| %>
      <tr>
        <td><%= payment.invoice_id %></td>
        <td><%= payment.amount %></td>
        <td><%= payment.change %></td>
        <td><%= payment.payment_method_id %></td>
        <td><%= payment.card_number %></td>
        <td><%= payment.card_provider_id %></td>
        <td><%= payment.card_transaction_ref %></td>
        <td><%= payment.created_at %></td>
        <td><%= payment.updated_at %></td>
        <td><%= payment.created_by %></td>
        <td><%= payment.updated_by %></td>
        <td><%= link_to "#{t(:show)}", payment %></td>
        <td><%= link_to "#{t(:edit)}", edit_payment_path(payment) %></td>
        <td><%= link_to "#{t(:destroy)}", payment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to "#{t(:new_payment)}", new_payment_path %>
